<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ListController
 *
 * @author Admin
 */
class User_ListController extends Zend_Controller_Action {

    public function init() {
        /* Initialize action controller here */
    }

    public function preDispatch() {
        $auth = Zend_Auth::getInstance();        
        if (!$auth->hasIdentity()) {
            $this->_redirect('/user/login');
        }
        
        $view = new Zend_View();
        $view->headTitle(' > List Users');
        $this->view->userDetail = $auth->getIdentity();
        
    }

    public function indexAction() {
        $userModel = new Application_Model_UserModel();
        $paginator = $userModel->getAllUsers($this->_request);
        $this->view->paginator = $paginator;
    }
    
    public function listAction(){
        $this->_helper->layout->disableLayout();
        $userModel = new Application_Model_UserModel();
        $paginator = $userModel->getAllUsers($this->_request);
        $this->view->paginator = $paginator;
    }

}